package com.caregiver.watch.business.user.enums;

import lombok.Getter;

/**
 * @description: 被照护人佩戴习惯枚举
 * @program: caregiver-watch
 * @author: 疆戟
 * @create: 2025-10-07 10:35
 */
@Getter
public enum CareRecipientWearingHabitEnum {

    /**
     * UNKNOWN 未知 LEFT_HAND 左手 RIGHT_HAND 右手
     */
    UNKNOWN(0, "未知"),
    LEFT_HAND(1, "左手"),
    RIGHT_HAND(2, "右手");
    private final Integer code;
    private final String desc;

    CareRecipientWearingHabitEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CareRecipientWearingHabitEnum parse(Integer code) {
        for (CareRecipientWearingHabitEnum value : CareRecipientWearingHabitEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
